import http from '@/utils/http'

export function delCartAPI(ids) {
  return http({
    url: '/member/cart',
    method: 'DELETE',
    data: {
      ids
    }
  })
}

export function addCartAPI(skuId, count) {
  return http({
    url: '/member/cart',
    method: 'POST',
    data: {
      skuId,
      count
    }
  })
}

export function getCartAPI() {
  return http({
    url: '/member/cart'
  })
}

// 合并购物车
export function mergeCartAPI(data) {
  return http({
    url: '/member/cart/merge',
    method: 'POST',
    // 没名字的字段就用data
    data
  })
}